using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebControls;
using BusinessLayer;
using InfraStructureLayer;

public partial class UserControls_uctArticleRandom : SFUserControl
{
    protected bool sfrArticleRandom_NeedsDataSource()
    {
        busArticles insBusArticles = new busArticles();
        DataTable insDataTableArticles = insBusArticles.SelectArticlesRandom();
        if (insBusArticles.HasErrors)
        {
            MessageBoxShow(insBusArticles);
            return true;
        }

        sfrArticleRandom.SetData(insDataTableArticles);
        return insBusArticles.HasErrors;
    }
    protected void ibtRss_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("~/" + CurrentContext.Language + "/Rss/RssArticles.ashx");
    }
    protected void lbtShowAll_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/" + CurrentContext.Language + "/articles/default.aspx");
    }
    protected string GenerateUrl(object obj)
    {
        return "~/" + CurrentContext.Language + "/articles/" + new Crypto().EncryptURL(obj.ToString()) + ".aspx";
    }
}
